\pagestyle{myheadings} \setcounter{page}{1} \setcounter{footnote}{0}

\section{~Ocean-Ice-Waves-Atmosphere coupling with OASIS} \label{app:coupling}
\newcounters 

\vssub
\subsection{~Introduction} \label{sec:couplingA}
\vssub

\ws\ has been interfaced with OASIS3-MCT to allow coupling simulations with atmosphere and/or ocean models.
OASIS (Ocean Atmosphere Sea Ice Soil)\footnote{https://verc.enes.org/oasis/} -- note that waves are missing in that acronym -- is a coupling software developed by the CERFACS and CNRS \citep{art:VAL13}.
The current OASIS3-MCT version is interfaced with MCT, the Model Coupling Toolkit \citep{art:LJO05,art:JLO05}.
developed by the Argonne National Laboratory.
The OASIS coupler is also interfaced with the SCRIP library developed by Los Alamos National Laboratory. All the information on how to use the OASIS coupler is present in the oasis user guide. Here we will just add the information about the use of OASIS in \ws.\\

In a nutshell, OASIS3-MCT ...

\begin{itemize}
  \item ... is totally parallelized
  \item ... doesn't have an executable (we don't need to give it processes when we launch a coupling simulation)
  \item ... is able to exchange 2D and 3D fields
  \item ... is able to exchange fields in parallel
  \item ... support unstructured grids
  \item ... uses an input file called \textit{namcouple} that allows changes to the coupling characteristics (exchange time, interpolation type, number of exchange fields) without recompiling the code...
\end{itemize}

\vssub
\subsection{~Interfacing with OASIS3-MCT} \label{sec:couplingB}
\vssub

To communicate with another model, a component model (ocean, wave, sea ice or atmosphere) needs to include a few specific calls to the OASIS3-MCT coupling library. To use these OASIS's functions in \ws\ we created 4 new modules:
\begin{itemize}
\item {\file w3oacpmd.ftn}, module containing common functions for atmosphere and ocean coupling. These functions are called before the temporal loop, in the {\code ww3\_shel} program.
\item {\file w3ogcmmd.ftn}, {\file w3igcmmd.ftn} and {\file w3agcmmd.ftn}, modules containing specific functions for, respectively, waves-ocean coupling,  waves-sea icecoupling and waves-atmosphere coupling.  These functions are called in the temporal loop.
\end{itemize}

\vssub
\subsection{~Compiling with OASIS3-MCT} \label{sec:couplingB}
\vssub

To use or not these coupling functions 5 switches were created: 

\begin{itemize}
\item switch {\code COU}, to perform the coupling : reading the {\file ww3\_shel.inp} input file and define the number of variable exchanged and the time exchange.
\item switch {\code OASIS}, to initialize the coupler OASIS {\file w3oacpmd.ftn}
\item switch {\code OASACM} and/or {\code OASOCM} and/or {\code OASICM}, to send/receive the coupling fields to/from the atmospheric model {\file w3agcmmd.ftn} and/or the oceanic model {\file w3ogcmmd.ftn} and/or the sea ice model {\file w3igcmmd.ftn}
\end{itemize}

To allow the use of OASIS, \ww~ should be compiled with the following switches. For 
a coupling with an atmospheric circulation model 
\command{COU OASIS OASACM}
and with an ocean circulation model
\command{COU OASIS OASOCM}
and with a sea ice model
\command{COU OASIS OASICM}
and both ocean and atmosphere circulation models 
\command{COU OASIS OASACM OASOCM}

Only the program {\code ww3\_shel} is compiled with the OASIS library, all the other programs can be used as usual. \\

The switches for interpolation in time of the wind and current forcing fields must not be used regarding the
fact that coupling mechanisms cannot provided the future value of the forcing field.
Depending on the type of coupling, the switch {\code WNT0} must be set for atmospheric coupling and the switch {\code CRT0} must be set for oceanic coupling.

\vssub
\subsection{~Launch a coupling simulation} \label{sec:couplingC}
\vssub

To launch a coupling simulation, for example with Intel Mpi, we need the: 

\begin{itemize}
\item input files for WW3 : {\file ww3\_shel.inp}, and the usual *.ww3 files.
\item input file for OASIS : {\file namcouple}
\item input files for ocean/sea ice/atmosphere models : {\file files depends on the model}
\end{itemize}

To launch a coupling simulation, the {\file mpirun} command should be used as follows

{\code mpirun -np \$nbre\_cores\_WW3 exe\_WW3 : -np \$nbre\_cores\_OA exe\_OA}

\vssub
\subsection{~Limitations} \label{sec:couplingD}
\vssub

A few limitations are not yet addressed, and will be addressed in a later version:

\begin{itemize}
\item the coupling with OASIS is only coding for ww3\_shel program, not yet for the {\code ww3\_multi}
\item in the WW3 suite, there are 2 versions of SCRIP, one for OASIS and one for the {\code ww3\_multi}
\item ...
\end{itemize}
